import random

MAX_WIDTH = 8
MAX_HIGHT = 8
MINES = 10

mines_list = []
for i in range(0, MINES):
    mines_list.append((random.randint(0, MAX_WIDTH - 1),
                       random.randint(0, MAX_HIGHT - 1)))

print(mines_list)

user_session = []

while True:
    print(' ', [str(i) for i in range(MAX_WIDTH)], sep = ' ')
    for i in range(MAX_WIDTH):
        line = []
        for j in range(MAX_WIDTH):
            if (j, i) not in user_session:
                line.append('*')
            else:
                line.append(' ')
        print(i, line)

    input_value = input('Введіть координати x y: ')
    x, y = input_value.split()

    if not x.isdigit() or not y.isdigit():
        continue

    x, y = int(x), int(y)
    if (x, y) in mines_list:
        print("You lose")
        break

    user_session.append((x, y))